<?php
/**
 * User: 五哥派
 * Date: 2024/7/1
 * Tel(同WX): 17335592719
 */
namespace app\api\controller;

use think\Controller;

class ApiBase extends Controller{

    /**
     * 获取post数据 (数组)
     * @param $key
     * @return mixed
     */
    protected final function postData($key = null)
    {
        return $this->request->post(empty($key) ? '' : "{$key}/a");
    }

    /**
     * 获取post数据 (数组)
     * @param string $key
     * @return mixed
     */
    protected final function postForm(string $key = 'form')
    {
        return $this->postData($key);
    }

}